﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;
using MVVMLightLesson.BLL;
using MVVMLightLesson.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MVVMLightLesson.ViewModels
{
    public class MainViewModel : ViewModelBase//ObservableObject
    {
		private string _value;

		public string Value
		{
			get { return _value; }
			set { _value = value;
				this.RaisePropertyChanged();//第一种通知方式
				//Set<string>(ref _value, value);//第二种通知方式
			}
		}

		public RelayCommand BtnCommand { get; set; }
		
		public RelayCommand<string> BtnParamCommand { get; set; }

       

        public MainViewModel(ILoginBLL loginBLL)
        {
            BtnCommand = new RelayCommand(BtnCommandExecute);
            BtnParamCommand = new RelayCommand<string>(BtnParamCommandExecute);
        }

        private void BtnParamCommandExecute(string arg)
        {
            Messenger.Default.Send<string>(arg);
        }

        private void BtnCommandExecute()
        {
            Messenger.Default.Send<string>("","aibu");
        }
    }
}
